@extends('adminDialog')

@section('content')
    <div class="pop_cont pop_table" style="height:400px;">

        <div class="nav">
            <ul class="cc">
                <li @if ($type == 'cash') class="current" @endif>
                    <a href="{{url('admin/users/accountlog/'.$user_id.'/cash')}}">余额</a>
                </li>
                @if (!in_array($user->user_type, [2,3,5,6]))
                <li @if ($type == 'card') class="current" @endif>
                    <a href="{{url('admin/users/accountlog/'.$user_id.'/card')}}">会员卡</a>
                </li>
                @endif
                <li @if ($type == 'coin') class="current" @endif>
                    <a href="{{url('admin/users/accountlog/'.$user_id.'/coin')}}">金币</a>
                </li>
            </ul>
        </div>

        <p class="mb10">
            <a href="{{url('admin/users/accountchange/'.$user_id)}}" class="btn J_dialog" title="账户调整">
                <span class="add"></span>账户调整
            </a>
        </p>

        <div class="table_list">
            <div id="data_list">
                <table class="items">
                    <thead>
                    <tr>
                        <th>时间</th>
                        <th>交易号</th>
                        <th>变更额度</th>
                        <th>变更后</th>
                        <th>备注</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($list as $item)
                        <tr>
                            <td>{{$item->created_at}}</td>
                            <td>{{$item->sn}}</td>
                            <td><span class="@if ($item->$type > 0) red @else green @endif">{{$item->$type}}</span></td>
                            <td>{{$item->$after}}</td>
                            <td width="20%">{{$item->intro}}</td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
            <div class="summary">
                共有 {{$list->total()}} 条数据
            </div>
            @if ($list->hasPages())
                <div class="pager">
                    {!! $list->render() !!}
                </div>
            @endif
        </div>

    </div>
@stop

@section('style')
    <style>
        .body_none {width: 700px;}
    </style>
@stop